package HeSuanServer.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @描述:
 * @author: LH
 * @date: 2022/12/3
 */
@Slf4j
@RestController
@RequestMapping("/demo")
@CrossOrigin
public class contollerDemo {
    @GetMapping("/get")
    public Map<String,String> demo(){
        HashMap map=new HashMap<>();
        map.put("1","1");
        return map;
    }
    @PostMapping("post")
    public Map<String,String> demo1(@RequestBody Map map){
        map.forEach((k,v)->{
            System.out.println(k+":"+v);
        });
        HashMap map1=new HashMap<>();
        map1.put("2","2");
        return map1;
    }
    @GetMapping("data")
    public void getData(){
        log.info("data"+ new Date());
    }
}
